package com.javaweb.web.eo.user;

import java.io.Serializable;

import com.javaweb.annotation.validate.CommonlyUsed;
import com.javaweb.constant.SystemConstant.LoginConstant;
import com.javaweb.enums.CommonCheckEnum;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class UserModifyRequest implements Serializable {

	private static final long serialVersionUID = 1922551924340836095L;
	
	@NotBlank(message="validated.user.userId.notEmpty")
	private String userId;//用户ID

	@NotBlank(message="validated.user.userName.notNull")
	@Pattern(regexp=LoginConstant.USERNAME_REGEXP,message="validated.user.userName.pattern")
	private String userName;//用户名
	
	@Size(max=20,message="validated.user.personName.maxLength.limit")
	private String personName;//用户姓名
	
	@Size(min=18,max=18,message="validated.user.idCard.maxLength.limit")
	@CommonlyUsed(allowEmpty=true,type=CommonCheckEnum.ID_CARD,message="validated.user.idCard.error")
	private String idCard;//身份证号码

	@Size(max=50,message="validated.user.email.maxLength.limit")
	@CommonlyUsed(allowEmpty=true,type=CommonCheckEnum.EMAIL,message="validated.user.email.error")
	private String email;//电子邮箱
	
	@Pattern(regexp="^\\d{11}$",message="validated.user.phone.maxLength.limit")
	@CommonlyUsed(allowEmpty=true,type=CommonCheckEnum.PHONE_NO,message="validated.user.phone.error")
	private String phone;//手机号码

	@Min(value=0,message="validated.user.status.value.limit")
	@Max(value=1,message="validated.user.status.value.limit")
	private Integer status = 0;//账号状态（0：正常；1：禁用）
	
	@Size(max=100,message="validated.user.remark.maxLength.limit")
	private String remark;//备注

}
